package com.coolgor.axnut.enums.auth;

public enum LocalUserOperationStateEnum {
	SUCCESS(1000, "操作成功"),
	INNER_ERROR(-1001, "内部系统错误"),
	NULL_USERID(-1002, "userId为空"),
	NULL_USER(-1003, "user信息为空"),
	NULL(-1004, "获取数据为空"),
	EMPTY_LIST(-1005, "数据列表为空"),
	EXISTUSERNAME(-1006, "用户名已存在");

	private int state;

	private String stateInfo;

	private LocalUserOperationStateEnum(int state, String stateInfo) {
		this.state = state;
		this.stateInfo = stateInfo;
	}

	public int getState() {
		return state;
	}

	public String getStateInfo() {
		return stateInfo;
	}

	public static LocalUserOperationStateEnum stateOf(int index) {
		for (LocalUserOperationStateEnum state : values()) {
			if (state.getState() == index) {
				return state;
			}
		}
		return null;
	}
}
